#ifndef _BONE_H_
#define _BONE_H_

#include "hltypes/hstring.h"
#include "hltypes/harray.h"
#include "gtypes/Quaternion.h"
#include "gtypes/Vector3.h"
#include "AskalExport.h"
#include "april/RenderSystem.h"

namespace askal
{
	
	struct AskalExport Bone
	{
		
		hstr mName;
		Bone *mParent;
		harray<Bone*> mChildren;
		
		gvec3 mTail; // end of a bone in bone-local space translated by mHead vector
		gvec3 mHead; // offset in bone-local space
		gquat mOrientation; // quaternion describeing bone-local space orientation
		
		Bone(const char *name = "Untitled", Bone *parent = NULL);
		void addChildBone(Bone *bone);
		bool isChild(chstr name);
		chstr getName();
		void setParentBone(Bone *bone);
		void setName(chstr newName);
		
	};
	
}

#endif // _BONE_H_